# -*- coding: utf-8 -*-
"""
@Time ： 2020/9/22 18:25
@Auth ： Mr. JJ_Cloud
@Company ：testingedu.com.cn
@Function ：python 第三方安装包
"""
import os

class PackageInstaller(object):
    def __init__(self):
        pass
    def install_package(self,package_name):
        os.system("pip install %s" % package_name)
    def install_3rd_package(self):
        self.install_package("requests")
        self.install_package("httprunner")
        self.install_package("selenium")
        self.install_package("openpyxl")
        self.install_package("robotframework")
        self.install_package("appium-python-client")
        self.install_package("uiautomator2")
        self.install_package("flask")
        self.install_package("django")
        self.install_package("locust")
        self.install_package("pillow")
        self.install_package("pandas")
        self.install_package("keyboard")
        self.install_package("python-jenkins")
        self.install_package("pyinstaller")
        self.install_package("python_docx")
        self.install_package("plotly")
        self.install_package("pyserial")
        self.install_package("pymysql")
        self.install_package("MySQLdb")
        self.install_package("mongodb")
        self.install_package("redis")

if __name__== '__main__':
    m_obj = PackageInstaller() #实例化一个对象
    m_obj.install_3rd_package() #该对象调用install_3rd_package函数
    os.system("pause") #暂停并查看执行结果避免直接关闭
